using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._GeostatisticalAnalystTools._Utilities
{
    /// <summary>
    /// <para>Neighborhood Selection</para>
    /// <para>Creates a layer of points based on a user-defined neighborhood.</para>
    /// <para>基于用户定义的邻域创建点图层。</para>
    /// </summary>    
    [DisplayName("Neighborhood Selection")]
    public class GANeighborhoodSelection : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public GANeighborhoodSelection()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_dataset">
        /// <para>Input point features</para>
        /// <para>Points used to create a neighborhood selection.</para>
        /// <para>用于创建邻域选择的点。</para>
        /// </param>
        /// <param name="_out_layer">
        /// <para>Output layer</para>
        /// <para>Layer to store the neighborhood selection.</para>
        /// <para>用于存储邻域选择的图层。</para>
        /// </param>
        /// <param name="_point_coord">
        /// <para>Input point</para>
        /// <para>The neighborhood center's x,y coordinate.</para>
        /// <para>邻里中心的 x，y 坐标。</para>
        /// </param>
        /// <param name="_neighbors_max">
        /// <para>Maximum neighbors to include</para>
        /// <para>The number of points to use in each sector. If a sector has the required number of points, all points in that sector are used.</para>
        /// <para>每个扇区中使用的点数。如果扇区具有所需的点数，则使用该扇区中的所有点。</para>
        /// </param>
        /// <param name="_neighbors_min">
        /// <para>Include at least</para>
        /// <para>The minimum number of points to use in each sector. If the minimum number of required points are not available in any given sector, the nearest available point outside the sector will be selected.</para>
        /// <para>每个扇区使用的最小点数。如果任何给定扇区中没有所需的最小点数，则将选择扇区外最近的可用点。</para>
        /// </param>
        /// <param name="_minor_semiaxis">
        /// <para>Minor semiaxis</para>
        /// <para>Size of the minor semiaxis of the search neighborhood.</para>
        /// <para>搜索邻域的短半轴的大小。</para>
        /// </param>
        /// <param name="_major_semiaxis">
        /// <para>Major semiaxis</para>
        /// <para>Size of the major semiaxis of the search neighborhood.</para>
        /// <para>搜索邻域的主半轴的大小。</para>
        /// </param>
        /// <param name="_angle">
        /// <para>Angle</para>
        /// <para>The angle of rotation of the neighborhood axis.</para>
        /// <para>邻域轴的旋转角度。</para>
        /// </param>
        public GANeighborhoodSelection(object _in_dataset, object _out_layer, object _point_coord, long? _neighbors_max, long? _neighbors_min, double? _minor_semiaxis, double? _major_semiaxis, double? _angle)
        {
            this._in_dataset = _in_dataset;
            this._out_layer = _out_layer;
            this._point_coord = _point_coord;
            this._neighbors_max = _neighbors_max;
            this._neighbors_min = _neighbors_min;
            this._minor_semiaxis = _minor_semiaxis;
            this._major_semiaxis = _major_semiaxis;
            this._angle = _angle;
        }
        public override string ToolboxName => "Geostatistical Analyst Tools";

        public override string ToolName => "Neighborhood Selection";

        public override string CallName => "ga.GANeighborhoodSelection";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_dataset, _out_layer, _point_coord, _neighbors_max, _neighbors_min, _minor_semiaxis, _major_semiaxis, _angle, _shape_type.GetGPValue()];

        /// <summary>
        /// <para>Input point features</para>
        /// <para>Points used to create a neighborhood selection.</para>
        /// <para>用于创建邻域选择的点。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input point features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_dataset { get; set; }


        /// <summary>
        /// <para>Output layer</para>
        /// <para>Layer to store the neighborhood selection.</para>
        /// <para>用于存储邻域选择的图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_layer { get; set; }


        /// <summary>
        /// <para>Input point</para>
        /// <para>The neighborhood center's x,y coordinate.</para>
        /// <para>邻里中心的 x，y 坐标。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input point")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _point_coord { get; set; }


        /// <summary>
        /// <para>Maximum neighbors to include</para>
        /// <para>The number of points to use in each sector. If a sector has the required number of points, all points in that sector are used.</para>
        /// <para>每个扇区中使用的点数。如果扇区具有所需的点数，则使用该扇区中的所有点。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum neighbors to include")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public long? _neighbors_max { get; set; }


        /// <summary>
        /// <para>Include at least</para>
        /// <para>The minimum number of points to use in each sector. If the minimum number of required points are not available in any given sector, the nearest available point outside the sector will be selected.</para>
        /// <para>每个扇区使用的最小点数。如果任何给定扇区中没有所需的最小点数，则将选择扇区外最近的可用点。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Include at least")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public long? _neighbors_min { get; set; }


        /// <summary>
        /// <para>Minor semiaxis</para>
        /// <para>Size of the minor semiaxis of the search neighborhood.</para>
        /// <para>搜索邻域的短半轴的大小。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minor semiaxis")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public double? _minor_semiaxis { get; set; }


        /// <summary>
        /// <para>Major semiaxis</para>
        /// <para>Size of the major semiaxis of the search neighborhood.</para>
        /// <para>搜索邻域的主半轴的大小。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Major semiaxis")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public double? _major_semiaxis { get; set; }


        /// <summary>
        /// <para>Angle</para>
        /// <para>The angle of rotation of the neighborhood axis.</para>
        /// <para>邻域轴的旋转角度。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Angle")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public double? _angle { get; set; }


        /// <summary>
        /// <para>Shape type</para>
        /// <para><xdoc>
        ///   <para>The geometry of the neighborhood.</para>
        ///   <bulletList>
        ///     <bullet_item>One sector— Single ellipse</bullet_item><para/>
        ///     <bullet_item>Four sectors— Ellipse divided into four sectors</bullet_item><para/>
        ///     <bullet_item>Four shifted sectors— Ellipse divided into four sectors and shifted 45 degrees</bullet_item><para/>
        ///     <bullet_item>Eight sectors— Ellipse divided into eight sectors</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>邻域的几何形状。</para>
        ///   <bulletList>
        ///     <bullet_item>一个扇区 — 单个椭圆</bullet_item><para/>
        ///     <bullet_item>四个扇区 — 椭圆分为四个扇区</bullet_item><para/>
        ///     <bullet_item>四个移动扇区 — 椭圆分为四个扇区并移动 45 度</bullet_item><para/>
        ///     <bullet_item>八个扇区 — 椭圆分为八个扇区</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Shape type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _shape_type_value _shape_type { get; set; } = _shape_type_value._ONE_SECTOR;

        public enum _shape_type_value
        {
            /// <summary>
            /// <para>One sector</para>
            /// <para>One sector— Single ellipse</para>
            /// <para>一个扇区 — 单个椭圆</para>
            /// </summary>
            [Description("One sector")]
            [GPEnumValue("ONE_SECTOR")]
            _ONE_SECTOR,

            /// <summary>
            /// <para>Four sectors</para>
            /// <para>Four sectors— Ellipse divided into four sectors</para>
            /// <para>四个扇区 — 椭圆分为四个扇区</para>
            /// </summary>
            [Description("Four sectors")]
            [GPEnumValue("FOUR_SECTORS")]
            _FOUR_SECTORS,

            /// <summary>
            /// <para>Four shifted sectors</para>
            /// <para>Four shifted sectors— Ellipse divided into four sectors and shifted 45 degrees</para>
            /// <para>四个移动扇区 — 椭圆分为四个扇区并移动 45 度</para>
            /// </summary>
            [Description("Four shifted sectors")]
            [GPEnumValue("FOUR_SECTORS_SHIFTED")]
            _FOUR_SECTORS_SHIFTED,

            /// <summary>
            /// <para>Eight sectors</para>
            /// <para>Eight sectors— Ellipse divided into eight sectors</para>
            /// <para>八个扇区 — 椭圆分为八个扇区</para>
            /// </summary>
            [Description("Eight sectors")]
            [GPEnumValue("EIGHT_SECTORS")]
            _EIGHT_SECTORS,

        }

        public GANeighborhoodSelection SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}